<?php
// Load jQuery
wp_enqueue_script('jquery');

// Load theme localization
if ( class_exists('xili_language') ) {
	define('THEME_TEXTDOMAIN', 'buffet');
	define('THEME_LANGS_FOLDER', '/language');	
} else {
	load_theme_textdomain('buffet', get_template_directory() . '/language');
}

$theme_data = get_theme( get_current_theme() );

// Define PHP file constants.
define( BF_DIR, TEMPLATEPATH );
define( BF_LIB, BF_DIR . '/includes' );

define( BF_CHILD_THEME_DIR, get_stylesheet_directory() );
define( BF_CHILD_THEME_LIB, BF_CHILD_THEME_DIR . '/includes' );

define( THEME_VERSION, $theme_data['Version'] );

// Load framework files.
require_once BF_LIB . '/framework/core.php';
require_once BF_LIB . '/framework/actions.php';
require_once BF_LIB . '/framework/filters.php';
require_once BF_LIB . '/framework/helpers.php';
require_once BF_LIB . '/framework/options.php';

// Load admin files.
if ( is_admin() ) require_once BF_LIB . '/framework/admin.php';

// Load extensions.
require_once BF_LIB . '/framework/extensions.php';
require_once BF_LIB . '/extensions/default-extensions.php';

// Load widgets.
require_once BF_LIB . '/widgets/search.php';

// Load default template files.
if ( file_exists(BF_CHILD_THEME_LIB . '/template.php') ) {
	require_once BF_CHILD_THEME_LIB . '/template.php';
}
if ( file_exists(BF_CHILD_THEME_LIB . '/sidebars.php') ) {
	require_once BF_CHILD_THEME_LIB . '/sidebars.php';
}

// Finally, load the launcher.
require_once BF_LIB . '/launcher.php';

/* End of file functions.php */
/* Location: ./functions.php */